{# Render Project Side Bar #}

<ul id="sidebar_list" class='nav nav-list'>


</ul>

<script type="text/javascript">


    $(document).ready(function () {

        page_of(
            '{{ project.name }}',
            '{{ project.code }}',
            "{%- if project.thumbnail -%}/{{ project.thumbnail.full_path }}{%- else -%}{{ request.static_url("stalker_pyramid:static/stalker/images/T_NO_IMAGE.gif")}}{%- endif -%}",
            '/projects/{{ project.id }}/update/dialog'
        );

        menu_of(
            'Dashboard',
            "{%- if request.current_route_path() == request.route_path('view_project', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
            '{{ request.route_url('view_project', id=project.id) }}',
            get_icon('dashboard'),
            ''
        );

        menu_of(
            'Tickets',
            "{%- if request.current_route_path() == request.route_path('list_entity_tickets', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
            '{{ request.route_url('list_entity_tickets', id=project.id) }}',
            get_icon('ticket'),
            '{{ project.open_tickets | count }}'
        );

        $.getJSON('/projects/{{ entity.id }}/tasks/count/').then(function (data) {
            menu_of(
                'Tasks',
                "{%- if request.current_route_path() == request.route_path('list_entity_tasks', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_entity_tasks', id=project.id) }}',
                get_icon('task'),
                data
            );
        });
        $.getJSON('/projects/{{ entity.id }}/assets/count/').then(function (data) {
            menu_of(
                'Assets',
                "{%- if request.current_route_path() == request.route_path('list_project_assets', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_project_assets', id=project.id) }}',
                get_icon('asset'),
                data
            );
        });
        $.getJSON('/projects/{{ entity.id }}/sequences/count/').then(function (data) {
            menu_of(
                'Sequences',
                "{%- if request.current_route_path() == request.route_path('list_project_sequences', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_project_sequences', id=project.id) }}',
                get_icon('sequence'),
                data
            );
        });
        $.getJSON('/projects/{{ entity.id }}/shots/count/').then(function (data) {
            menu_of('Shots',
                "{%- if request.current_route_path() == request.route_path('list_project_shots', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_project_shots', id=project.id) }}',
                get_icon('shot'),
                data);
        });
        $.getJSON('/entities/{{ entity.id }}/users/count/').then(function (data) {
            menu_of(
                'Users',
                "{%- if request.current_route_path() == request.route_path('list_project_users', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_project_users', id=project.id) }}',
                get_icon('user'),
                data
            );
        });

        $.getJSON('/entities/{{ entity.id }}/references/count/').then(function(data){
             menu_of(
                'References',
                "{%- if request.current_route_path() == request.route_path('list_entity_references', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_entity_references', id=project.id) }}',
                get_icon('reference'),
                data
             )
        });

        $.getJSON('/projects/{{ entity.id }}/reviews/count/').then(function(data){
            menu_of(
                'Reviews',
                "{%- if request.current_route_path() == request.route_path('list_project_reviews', id=project.id) -%}'active',{%- else -%},{%- endif -%}",
                '{{ request.route_url('list_project_reviews', id=project.id) }}',
                get_icon('review'),
                data
            )
        });
    })
</script>

<script type="text/javascript">
    $.getJSON('/projects/{{ entity.id }}/tasks/count/').then(function (data) {
        $(function(){
            $('#Tasks_count').text(data);
        })
    });
</script>

<script type="text/javascript">
    $.getJSON('/projects/{{ entity.id }}/assets/count/').then(function (data) {
        $(function(){
            $('#Assets_count').text(data);
        })
    });
</script>

<script type="text/javascript">
    $.getJSON('/projects/{{ entity.id }}/sequences/count/').then(function (data) {
        $(function () {
            $('#Sequences_count').text(data);
        });
    });
</script>

<script type="text/javascript">
    $.getJSON('/projects/{{ entity.id }}/shots/count/').then(function (data) {
        $(function () {
            $('#Shots_count').text(data);
        });
    });
</script>



<script type="text/javascript">
    $.getJSON('/entities/{{ entity.id }}/users/count/').then(function (data) {
        $(function (){
            $('#Users_count').text(data);
        });
    });
</script>


